<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8">
    <title>添加书籍分类</title>

    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <!-- page specific plugin styles -->
    <script src="__PUBLIC__/admin/js/jquery.min.js"></script>
    <script src="__PUBLIC__/admin/js/lodash.min.js"></script>
    <script src="__PUBLIC__/admin/js/moment.min.js"></script>
    <script src="__PUBLIC__/admin/js/zh-cn.js"></script>
    <script src="__PUBLIC__/admin/js/numeral.min.js"></script>
    <script src="__PUBLIC__/admin/js/toastr.min.js"></script>
    <script src="__PUBLIC__/admin/js/cookies.js"></script>
    <script src="__PUBLIC__/admin/js/knockout-min.js"></script>
    <script src="__PUBLIC__/admin/js/knockout.mapping.min.js"></script>
    <script src="__PUBLIC__/admin/js/bootstrap-datetimepicker.min.js"></script>
    <script src="__PUBLIC__/admin/js/jquery.validate.min.js"></script>
    <script src="__PUBLIC__/admin/js/jquery.validate.unobtrusive.min.js"></script>
    <script src="__PUBLIC__/admin/js/clipboard.min.js"></script>
    <script src="__PUBLIC__/admin/js/select2.min.js"></script>
    <script src="__PUBLIC__/admin/js/admin.js"></script>
    <script>
      moment.locale('zh-cn');
      toastr.options.positionClass = 'toast-bottom-right';
    </script>
    <!-- ace settings handler -->
    <script src="__PUBLIC__/admin/js/ace-extra.min.js"></script>
<link media="all" href="__PUBLIC__/admin/css/index14.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/glyphicons-halflings-regular.css">
</head>
<body class="no-skin">

    <!-- #section:basics/navbar.layout -->
<include file="./Public/gong/title.html" />

    <div class="main-container" id="main-container">
      <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
      </script>

      <div id="sidebar" class="sidebar responsive">
          <script type="text/javascript">
            try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
          </script>

<include file="./Public/gong/list.html" />


          <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
          </div>

          <script type="text/javascript">
            try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
          </script>
      </div>

      <!-- /section:basics/sidebar -->
      <div class="main-content">


        <div class="breadcrumbs" id="breadcrumbs">
          <script type="text/javascript">
            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
          </script>

          <ul class="breadcrumb">
            <li>
              <i class="ace-icon fa fa-home home-icon"></i>
              <a    href="#">Home</a>
            </li>
            <li class="active">分类修改/添加</li>
          </ul><!-- /.breadcrumb -->

          <!-- /section:basics/content.searchbox -->
        </div>

        <!-- /section:basics/content.breadcrumbs -->
        <div class="page-content">
          <div class="page-content-area">
            <div class="row">
              <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->

                <!--/span-->
                <!-- left menu ends -->



<div style="margin-bottom: 30px;">
    <ul class="nav nav-tabs">
        <li class="active"><a href="__URL__/add_book_type.html">添加书籍分类</a></li>
        <li class=""><a href="__URL__/book_type.html">修改书籍分类</a></li>
        <li class=""><a href="__URL__/add_book_txt.html">添加书籍(上传TXT)</a></li>
        <li class=""><a href="__URL__/add_book.html">添加书籍</a></li>
        <li class=""><a href="__URL__/add_book_info.html">添加章节</a></li>
        
    </ul>
</div>
<form id="main-form" class="form-horizontal" enctype="multipart/form-data" novalidate="novalidate" method="POST" action="__URL__/do_add_book_type">
    
    <div class="form-group">
        <label class="control-label col-sm-3">男生/女生</label>
        <div class="col-sm-2">
            男生<input name="sex"   value="1" <eq name="type.sex" value="1">checked="true"</eq>  type="radio">
            女生<input name="sex"   value="2" <eq name="type.sex" value="2">checked="true"</eq>  type="radio">
            <p class="help-block help-block-error col-sm-7 col-xs-10" data-valmsg-for="username" data-valmsg-replace="true"></p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-3">分类名称</label>
        <div class="col-sm-9">
            <input name="name" class="col-sm-5 col-xs-10"  value="{$type.name}" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-3">分类图片</label>
        <div class="col-sm-9">
            <img src='{$type.cover}' width="50" height="65">
            <input name="cover" class="col-sm-5 col-xs-10" type="file">
                <!--<span>把OSS上上传的图片地址填过来</span>-->
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-3">显示排序</label>
        <div class="col-sm-9">
            <input name="orderby" class="col-sm-5 col-xs-10"  value="{$type.orderby}" type="text">
                <span>数值小的靠前，0到100</span>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-3">关闭分类</label>
        <div class="col-sm-2">
            开<input name="closed"   value="0" <eq name="type.closed" value="0">checked="true"</eq>  type="radio">
            关<input name="closed"   value="1" <eq name="type.closed" value="1">checked="true"</eq> type="radio">
        </div>
        则当前下的小说也将不显示
    </div>
    

    <input type="hidden" name="id" value="{$type.id}"> 
    <div class="clearfix form-actions">
        <div class="col-md-offset-3 col-md-9">
            <button type="submit" class="btn btn-info" data-bind="click: submit, disable: submitting">保存</button>
        </div>
    </div>
</form>

<!-- <script>

    var viewModel = {
        raw_id: ko.observable(),
        username: ko.observable(),
        nickname: ko.observable(),
        token: ko.observable(),
        app_id: ko.observable(),
        app_secret: ko.observable(),
        submitting: ko.observable(false)
    };

    viewModel.submit = function () {
        if (viewModel.submitting()) {
            return false;
        }

        if (!$('#main-form').valid()) {
            return false;
        }

        viewModel.submitting(true);

        $.ajax({
            url: '/backend/settings/api_save_mp',
            type: 'POST',
            contentType: 'application/json',
            data: JSON.stringify(ko.mapping.toJS(viewModel))
        })
            .then(function () {
                toastr.success('保存成功');
            })
            .fail(handleAjaxError)
            .always(function () {
                viewModel.submitting(false);
            });
    };

    $(function () {
        ko.applyBindings(viewModel, document.getElementById('main-form'));

        $.get('/backend/settings/api_get_mp', function (data) {
            ko.mapping.fromJS(data, {}, viewModel);
        });
    })
</script> -->

                                <!-- PAGE CONTENT ENDS -->
                            </div><!-- /.col -->
                        </div><!-- /.row -->
                    </div><!-- /.page-content-area -->
                </div><!-- /.page-content -->
            </div><!-- /.main-content -->

        </div><!-- /.main-container -->

        <!-- basic scripts -->

       <!--  <script type="text/javascript">
            if('ontouchstart' in document.documentElement) document.write("<script src='http://novel.818tu.com/static/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
        </script> -->
        <script src="__PUBLIC__/admin/js/bootstrap.min.js"></script>
        <script src="__PUBLIC__/admin/js/jquery.webui-popover.min.js"></script>
        <script src="__PUBLIC__/admin/js/jquery.ui.widget.min.js"></script>
        <script src="__PUBLIC__/admin/js/jquery.fileupload.min.js"></script>

        <!-- page specific plugin scripts -->

        <!-- ace scripts -->
        <script src="__PUBLIC__/admin/js/ace-elements.min.js"></script>
        <script src="__PUBLIC__/admin/js/ace.min.js"></script>

        <!-- inline scripts related to this page -->

        <!-- the following scripts are used in demo only for onpage help and you don't need them -->


       <!--  <script type="text/javascript"> ace.vars['base'] = 'http://novel.818tu.com/static'; </script> -->
        <script src="__PUBLIC__/admin/js/elements.onpage-help.js"></script>
        <script src="__PUBLIC__/admin/js/ace.onpage-help.js"></script>


</body>
</html>
